<html>
<head><meta charset="utf-8"><title>Link static library to libstd fails for stage 1 · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Link.20static.20library.20to.20libstd.20fails.20for.20stage.201.html">Link static library to libstd fails for stage 1</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="197951255"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Link%20static%20library%20to%20libstd%20fails%20for%20stage%201/near/197951255" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Hughes <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Link.20static.20library.20to.20libstd.20fails.20for.20stage.201.html#197951255">(May 18 2020 at 15:29)</a>:</h4>
<p>Hi, I'm hacking around with a fork of rustc where I use a build script to link <code>libhello.a</code> to libstd. I build it with <code>src/libstd/build.rs</code> which also adds it to the library path:</p>
<p><code> 
    println!("cargo:rustc-link-search={}", OUT_DIR);
    println!("cargo:rustc-link-lib=static=hello");
</code> </p>
<p>This works like a charm for stage0, but when building stage1 I get a linker error <code>usr/bin/ld: cannot find -lhello</code>. Is there some bootstrapping magic that I'm missing?</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>